////////////////////////////////////////////////////////////////////////////////
// Filename: Game.h
////////////////////////////////////////////////////////////////////////////////
#ifndef _GAME_H_
#define _GAME_H_


//////////////
// INCLUDES //
//////////////
#include <Windows.h>
#include <xnamath.h>

#include "CDirect3D.h"
#include "Scene.h"
#include "BasicEffect.h"
#include "Camera.h"
#include "Texture.h"
#include "RenderItemManager.h"

class Model3D;
class PhysicShape;
class Character;
class Skybox;
class ExplosionsManager;
class ShadowRender;

class Game
{
public:
	Game();
	~Game();

	static Game* Instance();

	bool Initialize();
	void Uninit();
	void Update(int pElapsedTime);
	void PreRender();
	void Render();

	Camera* GetCamera();
	XMFLOAT3 GetOrigine();
	Scene* GetScene();

	PhysicShape* GetPhysicShape(int pIndex);
	BasicEffect* GetShader();
	Texture* GetTexture();
	ShadowRender* GetShadowRender();

	RenderItemManager* GetMainRenderItemManager();
	RenderItemManager* GetTransparentRenderItemManager();
	RenderItemManager* GetDecalRenderItemManager();

	void RenderItemsRaiseAllRemoveFlags();
	void RenderItemsRemoveItemsByFlag();

	XMFLOAT3 GetLightOrientation();
protected:
	static Game* mInstance;

	ID3D11DeviceContext* mDeviceContext;
	ID3D11Device* mDevice;

	Scene* mScene;
	Camera* mCamera;
	Character *mCharacter;

	float posiZ;

	PhysicShape *mPhysicShapes;

	BasicEffect *mShader;
	

	Texture *mTexture;

	RenderItemManager* mMainRenderItemManager;
	RenderItemManager* mTransparentRenderItemManager;
	RenderItemManager* mDecalRenderItemManager;

	XMFLOAT3 mOrigine;

	Skybox* mSkybox;
	ExplosionsManager* mExplosionsManager;
	ShadowRender *mShadowRender;
	XMFLOAT3 mLightOrientation;

	long mLastExplode;

};
#endif